package com.youdoneed.community.accounts.web;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.youdoneed.community.accounts.entity.Companybill;
import com.youdoneed.community.accounts.service.CompanyBillService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 公司开票模块请求控制器。
 * @author shum
 * @date 2017.5.26
 */
@RestController
@RequestMapping(value = "/companyBill" , method = {RequestMethod.GET,RequestMethod.POST})
@Api(value = "公司开票模块请求控制器", description = "公司开票模块的相关操作")
public class CompanyBillController {

	private static final Logger logger = LoggerFactory.getLogger(CompanyBillController.class);
	@Autowired
	CompanyBillService companyBillService;

    @RequestMapping(value = "/save", method = {RequestMethod.GET,RequestMethod.POST})
    @ApiOperation(notes = "后台保存公司开票", value = "后台保存公司开票")
    public boolean save(Companybill bill) {
        return companyBillService.save(bill);
    }

    @RequestMapping(value = "/update", method = {RequestMethod.GET,RequestMethod.POST})
    @ApiOperation(notes = "后台更新公司开票", value = "后台更新公司开票")
    public boolean update(Companybill bill) {
        return companyBillService.update(bill);
    }

    @RequestMapping(value = "/delete", method = {RequestMethod.GET,RequestMethod.POST})
    @ApiOperation(notes = "后台删除公司开票记录", value = "后台公司开票记录")
    public boolean delete(String id) {
        return companyBillService.delete(id);
    }
    
    @RequestMapping(value = "/selectById", method = {RequestMethod.GET,RequestMethod.POST})
    @ApiOperation(notes = "后台查询单条公司开票记录", value = "后台查询单条公司开票记录")
    public Companybill selectById(String id) {
        return companyBillService.selectById(id);
    }
}
